﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Customer.aspx.cs" Inherits="AdminSite.Pages.Customer.Customer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Customer config
    </h2>
    <h3>Search client</h3>
    <div style="margin-top:5px;">
        <p style="float:left;padding-left:10px;">Id:<asp:TextBox ID="SrcId" runat="server"></asp:TextBox></p>
        <p style="float:left;padding-left:10px;">Email:<asp:TextBox ID="SrcEmail" runat="server"></asp:TextBox></p>
        <p style="float:left;padding-left:10px;">Display Name:<asp:TextBox ID="SrcDspName" runat="server"></asp:TextBox></p>
        <p style="float:left;padding-left:10px;"><asp:Button ID="btnSearch" runat="server" 
                Text="Search" /></p>
    </div>
    <div class="clear"></div>
    <div style="overflow: auto;min-height:550px;margin-top:10px;">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="Id" DataSourceID="EntityDataSource1" AllowPaging="True" 
            AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="Id" HeaderText="Id" 
                    SortExpression="Id" ReadOnly="True" />
                <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                <asp:BoundField DataField="DisplayName" HeaderText="DisplayName" 
                    SortExpression="DisplayName" />
                <asp:ImageField DataImageUrlField="UriImagem" HeaderText="Picture" 
                    NullDisplayText="No image">
                    <ControlStyle Height="50px" Width="50px" />
                </asp:ImageField>
                <asp:BoundField DataField="DataNascimento" HeaderText="DataNascimento" 
                    SortExpression="DataNascimento" />
                <asp:BoundField DataField="Sexo" HeaderText="Sexo" SortExpression="Sexo" />
                <asp:BoundField DataField="Referencia" HeaderText="Referencia" 
                    SortExpression="Referencia" />
                <asp:BoundField DataField="IDSocial" HeaderText="IDSocial" 
                    SortExpression="IDSocial" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                <asp:BoundField DataField="Telefone" HeaderText="Telefone" 
                    SortExpression="Telefone" />
                <asp:BoundField DataField="Morada" HeaderText="Morada" 
                    SortExpression="Morada" />
                <asp:BoundField DataField="CodPostal" HeaderText="CodPostal" 
                    SortExpression="CodPostal" />
                <asp:BoundField DataField="Localidade" HeaderText="Localidade" 
                    SortExpression="Localidade" />
                <asp:BoundField DataField="Password" HeaderText="Password" 
                    SortExpression="Password" />
                <asp:CheckBoxField DataField="TornarSocial" HeaderText="TornarSocial" 
                    SortExpression="TornarSocial" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
        <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
            ConnectionString="name=GrupyzEntities" DefaultContainerName="GrupyzEntities" 
            EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
            EnableUpdate="True" EntitySetName="Cliente" 
            Where="(it.id = @id or @id is null) and (it.email=@email or @email is null) and (it.displayname =@dspname or @dspname is null)" 
            EntityTypeFilter="" Select="">
            <WhereParameters>
                <asp:ControlParameter ControlID="SrcId" DbType="Int32" Name="id" 
                    PropertyName="Text" ConvertEmptyStringToNull="true" />
                <asp:ControlParameter ControlID="SrcEmail" DbType="String" Name="email" 
                    PropertyName="Text" ConvertEmptyStringToNull="true"/>
                <asp:ControlParameter ControlID="SrcDspName" DbType="String" Name="dspname" 
                    PropertyName="Text" ConvertEmptyStringToNull="true"/>
            </WhereParameters>
        </asp:EntityDataSource>
    </div>
</asp:Content>
